package com.qdu.servlet;

import com.qdu.dao.UsersDao;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 从表格中删除一个用户
 *
 * @author Lenovo
 */
@WebServlet("/dous")
public class deleteOneUserServlet extends HttpServlet{

    //用户service类
    UsersDao userdao=new UsersDao();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String userId=req.getParameter("id");//获取用户id
        int rows=userdao.deleteOneUser(userId);//实现类.删除一个用户（userId）;
        if(rows!=0)
        {
            resp.getWriter().println(true);
        }
        else{
            resp.getWriter().println(false);
        }
    }

    
}
